/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hera.process.security.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author cmontes
 */
@Entity
@Table(name = "USER_LOGIN_HISTORY")
public class UserLoginHistory implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_USER_LOG_HISTORY")
    private Long idUserLogHistory;
    private String terminal;
    @Column(name = "PASSWORD_USED")
    private String passwordUsed;
    @Column(name = "SUCCESFUL_LOGIN")
    private Character succesfulLogin;
    private String module;
    @JoinColumn(name = "ID_USER", referencedColumnName = "ID_USER")
    @ManyToOne
    private User sysUser;

    public UserLoginHistory() {
    }

    public UserLoginHistory(Long idUserLogHistory) {
        this.idUserLogHistory = idUserLogHistory;
    }

    public Long getIdUserLogHistory() {
        return idUserLogHistory;
    }

    public void setIdUserLogHistory(Long idUserLogHistory) {
        this.idUserLogHistory = idUserLogHistory;
    }

    public String getTerminal() {
        return terminal;
    }

    public void setTerminal(String terminal) {
        this.terminal = terminal;
    }

    public String getPasswordUsed() {
        return passwordUsed;
    }

    public void setPasswordUsed(String passwordUsed) {
        this.passwordUsed = passwordUsed;
    }

    public Character getSuccesfulLogin() {
        return succesfulLogin;
    }

    public void setSuccesfulLogin(Character succesfulLogin) {
        this.succesfulLogin = succesfulLogin;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public User getSysUser() {
        return sysUser;
    }

    public void setSysUser(User sysUser) {
        this.sysUser = sysUser;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idUserLogHistory != null ? idUserLogHistory.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        
        if (!(object instanceof UserLoginHistory)) {
            return false;
        }
        UserLoginHistory other = (UserLoginHistory) object;
        if ((this.idUserLogHistory == null && other.idUserLogHistory != null) || (this.idUserLogHistory != null && !this.idUserLogHistory.equals(other.idUserLogHistory))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hera.process.data.domain2.UserLoginHistory[ idUserLogHistory=" + idUserLogHistory + " ]";
    }
    
}
